package mybatis.config;

import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;

/**
 * 自定义数字处理器
 */
public class MyIntegerTypeHandler implements MyTypeHandler<Integer> {
    @Override
    public void setParameter(PreparedStatement preparedStatement, int i, Object value) throws SQLException {
        preparedStatement.setInt(i, (Integer) value);
    }

    @Override
    public Integer getResult(ResultSet rs, String columnName) throws SQLException {
        return rs.getInt(columnName);
    }
}
